home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Conversion / Convert_PICT / Source / UncommentedPSCode / Arcs next >
Text File  |  1994-05-24  |  2KB  |  144 lines

  1. %BEGIN Arcs
  2. /arcpath
  3. {
  4.     /finishAng exch def
  5.     /startAng exch def
  6.     /lastright exch def
  7.     /lastbottom exch def
  8.     /lastleft exch def
  9.     /lasttop exch def
  10.     newpath        
  11.         lastright lastleft sub    % compute width & height
  12.         lastbottom lasttop sub
  13.         lastbottom lastleft setupForArcPath
  14.         /radius exch def
  15.         /yoffset exch def
  16.         /xoffset exch def
  17.         xoffset yoffset moveto
  18.         xoffset yoffset radius startAng finishAng arc
  19.     closepath
  20. }
  21. def
  22. /frameArc
  23. {
  24.     /finishAng exch def
  25.     /startAng exch def
  26.     /lastright exch def
  27.     /lastbottom exch def
  28.     /lastleft exch def
  29.     /lasttop exch def
  30.     
  31.     gsave
  32.         penPattern usePattern
  33.         
  34.         /thewidth lastright lastleft sub def
  35.         /theheight lastbottom lasttop sub def
  36.         penHeight 1 eq
  37.         penWidth 1 eq
  38.         and
  39.         {
  40.             newpath
  41.                 thewidth theheight lastbottom lastleft setupForArcPath
  42.                 startAng finishAng arc
  43.             stroke
  44.         }
  45.         {
  46.             penHeight 0 gt    % We don't want to draw with a 0 sized pen.
  47.             penWidth 0 gt
  48.             and
  49.             {
  50.                 /startmatrix  matrix  currentmatrix def
  51.                 newpath
  52.                     thewidth theheight lastbottom lastleft setupForArcPath
  53.                     startAng finishAng arc
  54.                     startmatrix setmatrix
  55.                     /innerRight lastright penWidth sub 1 add def
  56.                     /innerTop  lasttop penHeight add 1 sub def
  57.                     /innerLeft lastleft penWidth add 1 sub def
  58.                     /innerBottom lastbottom penHeight sub 1 add def
  59.                     /innerWidth innerRight innerLeft sub def
  60.                     /innerHeight innerBottom innerTop sub def
  61.                     
  62.                     innerWidth innerHeight innerBottom innerLeft
  63.                     setupForArcPath
  64.                     finishAng startAng  arcn
  65.                 closepath
  66.                 fill
  67.             }
  68.             if
  69.         }
  70.         ifelse
  71.     grestore
  72. }
  73. def
  74. /paintArc
  75. {
  76.     gsave
  77.         penPattern usePattern
  78.         arcpath
  79.         fill
  80.     grestore
  81. }
  82. def
  83. /eraseArc
  84. {
  85.     gsave
  86.         backPattern usePattern
  87.         arcpath
  88.         fill
  89.     grestore
  90. }
  91. def
  92. /invertArc
  93. {
  94.     gsave
  95.         arcpath
  96.     grestore
  97. }
  98. def
  99. /fillArc
  100. {
  101.     gsave
  102.         fillPattern usePattern
  103.         arcpath
  104.         fill
  105.     grestore
  106. }
  107. def
  108. /frameSameArc
  109.     /endAng exch def
  110.     /startAng exch def
  111.     lasttop lastleft lastbottom lastright startAng endAng frameArc
  112. }
  113. def
  114. /paintSameArc
  115.     /endAng exch def
  116.     /startAng exch def
  117.     lasttop lastleft lastbottom lastright startAng endAng paintArc
  118. }
  119. def
  120. /eraseSameArc
  121.     /endAng exch def
  122.     /startAng exch def
  123.     lasttop lastleft lastbottom lastright startAng endAng eraseArc
  124. }
  125. def
  126. /invertSameArc
  127.     /endAng exch def
  128.     /startAng exch def
  129.     lasttop lastleft lastbottom lastright startAng endAng invertArc
  130. }
  131. def
  132. /fillSameArc
  133.     /endAng exch def
  134.     /startAng exch def
  135.     lasttop lastleft lastbottom lastright startAng endAng fillArc
  136. }
  137. def
  138. %END Arcs
  139.